package com.som.beanconvert.data3.output;

import java.util.Map;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.ss.usermodel.Row;

import com.som.bean.data3.IpSectionInfo;
import com.som.beanconvert.ExcelColumnProcessInf;
import com.som.beanconvert.ExcelDataParseOutputInf;

/**
 * 格式2：首地直，尾地址，信息(sheet页的名称为IP_SECTION)
 * 
 * @author liujun
 * @date 2016年4月8日
 * @verion 0.0.1
 */
public class IpSectionInfoExcelOutput extends IpSectionInfo implements ExcelDataParseOutputInf<IpSectionInfo>, ExcelColumnProcessInf
{

	public void setExcelColumn(Map<String, String> column, Row row)
	{
		HSSFRow hrow = (HSSFRow) row;

		// 设置ip信息
		HSSFCell cellIp = hrow.createCell(0);
		cellIp.setCellType(HSSFCell.CELL_TYPE_STRING);
		cellIp.setCellValue("IP_start");
		// 设置ip信息
		HSSFCell cellipEnd = hrow.createCell(1);
		cellipEnd.setCellType(HSSFCell.CELL_TYPE_STRING);
		cellipEnd.setCellValue("IP_end");
		// 设置ip信息
		HSSFCell cellMsg = hrow.createCell(2);
		cellMsg.setCellType(HSSFCell.CELL_TYPE_STRING);
		cellMsg.setCellValue("message");

	}

	public void parseExcelRow(IpSectionInfo beaninfo, Row row)
	{
		HSSFRow hrow = (HSSFRow) row;

		// 设置ip信息
		HSSFCell cellIp = hrow.createCell(0);
		cellIp.setCellType(HSSFCell.CELL_TYPE_STRING);
		cellIp.setCellValue(beaninfo.getIpaddress());
		// 设置ip信息
		HSSFCell cellipEnd = hrow.createCell(1);
		cellipEnd.setCellType(HSSFCell.CELL_TYPE_STRING);
		cellipEnd.setCellValue(beaninfo.getIpEnd());
		// 设置ip信息
		HSSFCell cellMsg = hrow.createCell(2);
		cellMsg.setCellType(HSSFCell.CELL_TYPE_STRING);
		cellMsg.setCellValue(beaninfo.getMsginfo());
	}

}
